/**
 * 
 */
package com.hector.meinewerk.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Product {
	private String id;
	private String name;
	private double price;
	private double discount;
	private String remainProduct;
	private String shortDesc;
	private String description;
//	private String []tags;
	private String tags;
	private String currency;
	private String []categories;
	private String []colors;
	private String []sizes;
	private String []weights;
	private boolean isFeatureProduct;
	private boolean isSpeccial;
	private boolean isActive;
	private String createDate;
	private String []images;
	private String medias;
	private Category category;
	private static Product currentProduct;
	private String ownerEmail;
	
	public static Product getCurrentProduct(){
		return currentProduct;
	}
	
	public static void setCurrentProduct(Product product){
		currentProduct = product;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public double getDiscount() {
		return discount;
	}
	public void setDiscount(double discount) {
		this.discount = discount;
	}
	public String getRemainProduct() {
		return remainProduct;
	}
	public void setRemainProduct(String remainProduct) {
		this.remainProduct = remainProduct;
	}
	public String getShortDesc() {
		return shortDesc;
	}
	public void setShortDesc(String shortDesc) {
		this.shortDesc = shortDesc;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getCreateDate() {
		return createDate;
	}
	public void setCreateDate(String createDate) {
		
		
			String strToDate = createDate;
			SimpleDateFormat fromFM = new SimpleDateFormat("dd-MM-yyyy");
			SimpleDateFormat toFM = new SimpleDateFormat("dd.MM.yyyy");
			try {
				Date dateFrom = fromFM.parse(createDate);
				strToDate = toFM.format(dateFrom);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
		
		this.createDate = strToDate;
	}
	public String []getImage() {
		return images;
	}
	public void setImage(String []images) {
		this.images = images;
	}
	public boolean isFeatureProduct() {
		return isFeatureProduct;
	}
	public void setFeatureProduct(int isFeatureProduct) {
		if(isFeatureProduct == 0)	{	
			this.isFeatureProduct = false;
		}
		else{
			this.isFeatureProduct = true;
		}
	}
	public boolean isSpeccial() {
		return isSpeccial;
	}
	public void setSpeccial(int isSpeccial) {
		if(isSpeccial == 0)	{	
			this.isSpeccial = false;
		}
		else{
			this.isSpeccial = true;
		}
	}
	public boolean isActive() {
		return isActive;
	}
	public void setActive(int isActive) {
		if(isActive == 0)	{	
			this.isActive = false;
		}
		else{
			this.isActive = true;
		}
	}
	private String [] getCategories() {
		return categories;
	}
	private void setCategories(String [] categories) {
		this.categories = categories;
	}
	private String [] getColors() {
		return colors;
	}
	private void setColors(String [] colors) {
		this.colors = colors;
	}
	private String [] getSizes() {
		return sizes;
	}
	private void setSizes(String [] sizes) {
		this.sizes = sizes;
	}
	private String [] getWeights() {
		return weights;
	}
	private void setWeights(String [] weights) {
		this.weights = weights;
	}
	public Category getCategory() {
		return category;
	}
	public void setCategory(Category category) {
		this.category = category;
	}
	public String getMedias() {
		return medias;
	}
	public void setMedias(String medias) {
		this.medias = medias;
	}

	/**
	 * @return the tags
	 */
	public String getTags() {
		return tags;
	}

	/**
	 * @param tags the tags to set
	 */
	public void setTags(String tags) {
		this.tags = tags;
	}

	/**
	 * @return the currency
	 */
	public String getCurrency() {
		return currency;
	}

	/**
	 * @param currency the currency to set
	 */
	public void setCurrency(String currency) {
		this.currency = currency;
	}

	/**
	 * @return the ownerEmail
	 */
	public String getOwnerEmail() {
		return ownerEmail;
	}

	/**
	 * @param ownerEmail the ownerEmail to set
	 */
	public void setOwnerEmail(String ownerEmail) {
		this.ownerEmail = ownerEmail;
	}
}
